Skip to content

feat(mono): remove sql file & update router with utoipa#1068

Merged
genedna merged 1 commit into
gitmono-dev:mainfrom
benjamin-747:main
May 26, 2025
Merged

feat(mono): remove sql file & update router with utoipa#1068
genedna merged 1 commit into
gitmono-dev:mainfrom
benjamin-747:main

Conversation

@benjamin-747

Copy link
Copy Markdown
Collaborator

No description provided.

@benjamin-747
benjamin-747 requested a review from genedna May 26, 2025 09:21
@genedna
genedna requested a review from Copilot May 26, 2025 09:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes legacy SQL initialization files and updates the HTTP routers to use Utoipa for OpenAPI generation.

  • Deleted SQLite/Postgres init scripts and related README, moving toward SeaORM migrations
  • Introduced Utoipa annotations on MR and Issue endpoints and switched to routes! macro
  • Updated jupiter storage/init logic and cleaned up SQL file references

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sql/sqlite/sqlite_20241204_init.sql Removed legacy SQLite init script
sql/postgres/pg_20241204__init.sql Removed legacy Postgres init script
sql/README.md Deleted SQL update guide
mono/src/server/https_server.rs Added ISSUE_TAG constant
mono/src/api/mr/mr_router.rs Refactored MR routes, added Utoipa paths, commented auth
mono/src/api/api_router.rs Changed /create-file from GET to POST
jupiter/src/storage/mono_storage.rs Commented out IsMr filter
jupiter/src/storage/init.rs Removed setup_sql transaction logic
jupiter/sqlite_20241204_init.sql Now empty, previously included external SQL
docs/development.md Removed outdated SQL instructions
Comments suppressed due to low confidence (8)

jupiter/src/storage/init.rs:54

  • The setup_sql function (and its imports) is commented out but still present. Remove unused code or fully restore it to keep the file clean and ensure initialization logic remains correct.
/// create table from .sql file

jupiter/sqlite_20241204_init.sql:1

  • This file is now empty except for a relative path reference. Either restore valid SQL or remove the file reference entirely to avoid initialization errors.
../sql/sqlite/sqlite_20241204_init.sql

docs/development.md:49

  • Documentation still outlines manual SQL updates and filename conventions that no longer apply after switching to SeaORM migrations. Update this section to reflect the new migration workflow.
Whenever making any updates to the SQL content

mono/src/api/issue/issue_router.rs:35

  • Several new Issue endpoints have been added without accompanying tests. Add unit or integration tests to cover fetch_issue_list, new_issue, and other handlers to ensure reliability.
async fn fetch_issue_list

mono/src/api/mr/mr_router.rs:64

  • You’ve commented out permission checks and hardcoded user values (0, "admin"), effectively disabling auth. Restore proper LoginUser extraction and permission checks to prevent unauthorized access.
.reopen_mr(mr.into(), 0, "admin")

mono/src/api/api_router.rs:83

  • Changing /create-file from GET to POST may break existing clients and docs. Ensure you update documentation and client-side code to match the new method.
post,

jupiter/src/storage/mono_storage.rs:92

  • Commenting out the IsMr filter means you’ll fetch all refs (including merge requests), which can degrade performance and return unintended data. Re-enable or adjust this filter.
// .filter(mega_refs::Column::IsMr.eq(false))

mono/src/api/issue/issue_router.rs:14

  • [nitpick] Importing SaveCommentRequest from the mr module in the issue router creates cross-module coupling. Consider moving shared types to a common module or defining a dedicated type in the issue API.
use crate::api::mr::{SaveCommentRequest};

@vercel

vercel Bot commented May 26, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2025 9:41am

@genedna
genedna added this pull request to the merge queue May 26, 2025
Merged via the queue into gitmono-dev:main with commit 527cf56 May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants